const pino = require("pino");
const koaPinoLogger = require("koa-pino-logger");
const logger = pino({
  level: "info",
  transport:
    process.env.NODE_ENV === "development"
      ? {
          target: "pino-pretty",
          options: {
            colorize: true,
            levelFirst: true,
          },
        }
      : {
          target: "pino-roll",
          options: {
            file: join("logs", "log.txt"),
            frequency: "daily",
            mkdir: true,
            size: "10m",
          },
        },
});
const loggerMiddleware = koaPinoLogger({ logger });
module.exports = {loggerMiddleware,logger};
